package com.oa.tools.utils;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;

public class ExceptionUtil {

	
	public static String getStackTrace(Throwable t) {
	    StringWriter sw = new StringWriter();
	    PrintWriter pw = new PrintWriter(sw);
	    try {
	        t.printStackTrace(pw);
	        return sw.toString();
	    } finally {
	        pw.close();
	        try {
				sw.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
	    }
	}
	
}
